package com.zcily.demo.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 菜单权限表
 * </p>
 *
 * @author CGG
 * @since 2025-11-05
 */
@Getter
@Setter
@TableName("sys_permission")
@ApiModel(value = "Permission对象", description = "菜单权限表")
public class Permission implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty("父id")
    @TableField("parent_id")
    private String parentId;

    @ApiModelProperty("菜单标题")
    @TableField("name")
    private String name;

    @ApiModelProperty("路径")
    @TableField("url")
    private String url;

    @ApiModelProperty("组件")
    @TableField("component")
    private String component;

    @ApiModelProperty("是否路由菜单: 0:不是  1:是（默认值1）")
    @TableField("is_route")
    private Boolean isRoute;

    @ApiModelProperty("组件名字")
    @TableField("component_name")
    private String componentName;

    @ApiModelProperty("一级菜单跳转地址")
    @TableField("redirect")
    private String redirect;

    @ApiModelProperty("菜单类型(0:一级菜单; 1:子菜单:2:按钮权限)")
    @TableField("menu_type")
    private Integer menuType;

    @ApiModelProperty("菜单权限编码")
    @TableField("perms")
    private String perms;

    @ApiModelProperty("权限策略1显示2禁用")
    @TableField("perms_type")
    private String permsType;

    @ApiModelProperty("菜单排序")
    @TableField("sort_no")
    private Double sortNo;

    @ApiModelProperty("聚合子路由: 1是0否")
    @TableField("always_show")
    private Boolean alwaysShow;

    @ApiModelProperty("菜单图标")
    @TableField("icon")
    private String icon;

    @ApiModelProperty("是否叶子节点:    1是0否")
    @TableField("is_leaf")
    private Boolean isLeaf;

    @ApiModelProperty("是否缓存该页面:    1:是   0:不是")
    @TableField("keep_alive")
    private Boolean keepAlive;

    @ApiModelProperty("是否隐藏路由: 0否,1是")
    @TableField("hidden")
    private Integer hidden;

    @ApiModelProperty("是否隐藏tab: 0否,1是")
    @TableField("hide_tab")
    private Integer hideTab;

    @ApiModelProperty("描述")
    @TableField("description")
    private String description;

    @ApiModelProperty("在线状态(0-下线 1-在线)")
    @TableField("is_online")
    private Integer isOnline;

    @ApiModelProperty("创建人")
    @TableField("create_by")
    private String createBy;

    @ApiModelProperty("创建时间")
    @TableField("create_time")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty("更新人")
    @TableField("update_by")
    private String updateBy;

    @ApiModelProperty("更新时间")
    @TableField("update_time")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @ApiModelProperty("删除状态 0正常 1已删除")
    @TableField("del_flag")
    private Integer delFlag;

    @ApiModelProperty("是否添加数据权限1是0否")
    @TableField("rule_flag")
    private Integer ruleFlag;

    @ApiModelProperty("按钮权限状态(0无效1有效)")
    @TableField("status")
    private String status;

    @ApiModelProperty("外链菜单打开方式 0/内部打开 1/外部打开")
    @TableField("internal_or_external")
    private Boolean internalOrExternal;
}
